package com.yumeng.webapp.shiro.controller;

import com.yumeng.common.api.ApiResult;
import com.yumeng.webapp.shiro.auth.AuthHelper;
import com.yumeng.webapp.shiro.auth.CurrAuthInfo;
import com.yumeng.webapp.shiro.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author wxd
 * @date 2025/9/19 19:57
 */
@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    @GetMapping("/doSomething.do")
    public ApiResult doSomething() {
        CurrAuthInfo authInfo = AuthHelper.getCurrAuthInfo();
        return ApiResult.successData(authInfo);
    }

    @GetMapping("/testCache.do")
    public ApiResult testCache(Long id) {
        Object obj = testService.testCache(String.valueOf(id));
        return ApiResult.successData(obj);
    }

}
